package my.package0331;
import java.util.Scanner;
public class dome5 {
//5、打印菱形，用户输入菱形边长，用*打印出空心菱形。
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入菱形的边长");
            int number = sc.nextInt();
            for (int i = 1; i <= number; i++) {
                for (int j = 1; j <= number - i; j++) {
                    System.out.print(" ");
                }
                for (int k = number - i + 1; k <= number + i - 1; k++) {
                    System.out.print("*");
                }
                System.out.println();
            }
            for (int i = number + 1; i < 2 * number; i++) {
                for (int j = 1; j <= (i - number); j++) {
                    System.out.print(" ");
                }
                for (int k = (i - number + 1); k < 3 * number - i; k++) {
                    System.out.print("*");
                }
                System.out.println();
            }
        }
}
